package ${package}.dao;

import ${package}.entity.${entityClassName};
import ${package}.vo.${voClassName};
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


/**
<#if config.commentConfig.isAddFunctionComment == true>
 * 	${table.tableName}（${table.tableComment}）的dao层接口
</#if>
<#if config.commentConfig.isAddAuthorComment == true>
 *	@author ${author}
</#if>
  <#if config.commentConfig.isAddDateComment == true>
 *	@Date ${date}
</#if>
 */
@Mapper
public interface ${daoClassName} {
   
<#if config.daoJavaConfig.isCreateCountMethod == true>
	/**
	 <#if config.commentConfig.isAddFunctionComment == true>
     * 	条件查询，获取数量
     </#if>
     <#if config.commentConfig.isAddParamComment == true>
 	 *	@param query 查询条件{@link ${voClassName}}
 	 </#if>
 	 <#if config.commentConfig.isAddReturnComment == true>
 	 *	@return int 符合条件的记录数量
 	 </#if>
     <#if config.commentConfig.isAddAuthorComment == true>
     *	@author ${author}
     </#if>
      <#if config.commentConfig.isAddDateComment == true>
 	 *	@Date ${date}
 	 </#if>
     */
	int ${config.daoJavaConfig.countMethodName}(${voClassName} query);
</#if>


<#if config.daoJavaConfig.isCreateGetAllMethod == true>
	/**
	 <#if config.commentConfig.isAddFunctionComment == true>
     * 	条件查询，获取全部
     </#if>
     <#if config.commentConfig.isAddParamComment == true>
 	 *	@param query 查询条件{@link ${voClassName}}
 	 </#if>
 	 <#if config.commentConfig.isAddReturnComment == true>
  	 *	@return List<${entityClassName}> 符合条件的记录
  	 </#if>
     <#if config.commentConfig.isAddAuthorComment == true>
     *	@author ${author}
     </#if>
      <#if config.commentConfig.isAddDateComment == true>
 	 *	@Date ${date}
 	 </#if>
     */
	List<${entityClassName}> ${config.daoJavaConfig.getAllMethodName}(${voClassName} query);
</#if>


<#if config.daoJavaConfig.isCreateGetAllPageMethod == true>
	/**
	 <#if config.commentConfig.isAddFunctionComment == true>
     * 	条件查询，分页获取
     </#if>
     <#if config.commentConfig.isAddParamComment == true>
 	 *	@param query 查询条件{@link ${voClassName}}
 	 </#if>
 	 <#if config.commentConfig.isAddReturnComment == true>
 	 *	@return List<${entityClassName}> 符合条件的记录，分页
 	 </#if>
     <#if config.commentConfig.isAddAuthorComment == true>
     *	@author ${author}
     </#if>
      <#if config.commentConfig.isAddDateComment == true>
 	 *	@Date ${date}
 	 </#if>
     */
	List<${entityClassName}> ${config.daoJavaConfig.getAllPageMethodName}(@Param(value = "query")${voClassName} query
			,@Param(value = "pageNum")Integer pageNum
			,@Param(value = "pageSize")Integer pageSize);
</#if>


<#if config.daoJavaConfig.isCreateGetOneByIdMethod == true>
	/**
	 <#if config.commentConfig.isAddFunctionComment == true>
     * 	根据主键id获取
     </#if>
     <#if config.commentConfig.isAddParamComment == true>
 	 *	@param id 主键id
 	 </#if>
 	 <#if config.commentConfig.isAddReturnComment == true>
 	 *	@return ${entityClassName} 符合条件的记录
 	 </#if>
     <#if config.commentConfig.isAddAuthorComment == true>
     *	@author ${author}
     </#if>
      <#if config.commentConfig.isAddDateComment == true>
 	 *	@Date ${date}
 	 </#if>
     */
	${entityClassName} ${config.daoJavaConfig.getOneByIdMethodName}(${table.primaryKey.javaType} id);
</#if>


<#if config.daoJavaConfig.isCreateDeleteByIdMethod == true>
	/**
	 <#if config.commentConfig.isAddFunctionComment == true>
     * 	根据主键id删除记录
     </#if>
     <#if config.commentConfig.isAddParamComment == true>
 	 *	@param id 主键id
 	 </#if>
 	 <#if config.commentConfig.isAddReturnComment == true>
 	 *	@return int 删除的数量
 	 </#if>
     <#if config.commentConfig.isAddAuthorComment == true>
     *	@author ${author}
     </#if>
      <#if config.commentConfig.isAddDateComment == true>
 	 *	@Date ${date}
 	 </#if>
     */
	int ${config.daoJavaConfig.deleteByIdMethodName}(${table.primaryKey.javaType} id);
</#if>


<#if config.daoJavaConfig.isCreateInsertNotNullFieldMethod == true>
	/**
	 <#if config.commentConfig.isAddFunctionComment == true>
     * 	非空字段插入
     </#if>
     <#if config.commentConfig.isAddParamComment == true>
 	 *	@param entity 实体JavaBean，详情看{@link ${entityClassName}}
 	 </#if>
 	 <#if config.commentConfig.isAddReturnComment == true>
 	 *	@return int 插入的数量
 	 </#if>
     <#if config.commentConfig.isAddAuthorComment == true>
     *	@author ${author}
     </#if>
      <#if config.commentConfig.isAddDateComment == true>
 	 *	@Date ${date}
 	 </#if>
     */
	int ${config.daoJavaConfig.insertNotNullFieldMethodName}(${entityClassName} entity);
</#if>


<#if config.daoJavaConfig.isCreateInsertAllFieldMethod == true>
	/**
	 <#if config.commentConfig.isAddFunctionComment == true>
     * 	全字段插入
     </#if>
     <#if config.commentConfig.isAddParamComment == true>
 	 *	@param entity 实体JavaBean，详情看{@link ${entityClassName}}
 	 </#if>
 	 <#if config.commentConfig.isAddReturnComment == true>
 	 *	@return int 插入的数量
 	 </#if>
     <#if config.commentConfig.isAddAuthorComment == true>
     *	@author ${author}
     </#if>
      <#if config.commentConfig.isAddDateComment == true>
 	 *	@Date ${date}
 	 </#if>
     */
	int ${config.daoJavaConfig.insertAllFieldMethodName}(${entityClassName} entity);
</#if>


<#if config.daoJavaConfig.isCreateUpdateNotNullFieldMethod == true>
	/**
	 <#if config.commentConfig.isAddFunctionComment == true>
     * 	根据主键，非空字段更新，主键不更新
     </#if>
     <#if config.commentConfig.isAddParamComment == true>
 	 *	@param entity 实体JavaBean，详情看{@link ${entityClassName}}
 	 </#if>
 	 <#if config.commentConfig.isAddReturnComment == true>
 	 *	@return int 更新的数量
 	 </#if>
     <#if config.commentConfig.isAddAuthorComment == true>
     *	@author ${author}
     </#if>
      <#if config.commentConfig.isAddDateComment == true>
 	 *	@Date ${date}
 	 </#if>
     */
	int ${config.daoJavaConfig.updateNotNullFieldMethodName}(${entityClassName} entity);
</#if>


<#if config.daoJavaConfig.isCreateUpdateAllFieldMethod == true>
	/**
	 <#if config.commentConfig.isAddFunctionComment == true>
     * 	根据主键，全字段更新，主键不更新
     </#if>
     <#if config.commentConfig.isAddParamComment == true>
 	 *	@param entity 实体JavaBean，详情看{@link ${entityClassName}}
 	 </#if>
 	 <#if config.commentConfig.isAddReturnComment == true>
 	 *	@return int 更新的数量
 	 </#if>
     <#if config.commentConfig.isAddAuthorComment == true>
     *	@author ${author}
     </#if>
      <#if config.commentConfig.isAddDateComment == true>
 	 *	@Date ${date}
 	 </#if>
     */
	int ${config.daoJavaConfig.updateAllFieldMethodName}(${entityClassName} entity);
</#if>
}